///**************************************************************************************
// *
// * @(#) TemplateController.java
// * @Package com.jgdt.jgdtkasannong_university_gene_backend.controller
// **************************************************************************************/
//package com.jgdt.jgdtkasannong_university_gene_backend.controller.test;
//
//import cn.hutool.core.io.resource.Resource;
//import jakarta.servlet.http.HttpServletResponse;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.http.HttpStatus;
//import org.springframework.http.ResponseEntity;
//import org.springframework.web.bind.annotation.*;
//import org.springframework.web.context.request.async.DeferredResult;
//import org.springframework.web.multipart.MultipartFile;
///**
// * @description:
// * @author: huangAn 测试接口 todo 测试，注意生产需要注释该接口
// * @createDate: 2025/04/29
// */
//@RestController
//@RequestMapping("test/template")
//public class TemplateController {
//
//    @Autowired
//    private TemplateService templateService;
//
//    @GetMapping("/download")
//    public void downloadTemplate(HttpServletResponse response) {
//        templateService.downloadTemplate(response);
//    }
//
//    @PostMapping("/import")
//    public ResponseEntity<String> importData(@RequestParam("file") MultipartFile file) {
//        templateService.importData(file);
//        return ResponseEntity.ok("导入处理中");
//    }
//
//    @GetMapping("/download1")
//    public DeferredResult<ResponseEntity<Resource>> downloadTemplate() {
//        DeferredResult<ResponseEntity<Resource>> deferredResult = new DeferredResult<>(30000L);
//        deferredResult.onTimeout(() ->
//                deferredResult.setErrorResult(ResponseEntity.status(HttpStatus.REQUEST_TIMEOUT)
//                        .body("Request timeout")));
//        templateService.asyncGenerateTemplate(deferredResult);
//        return deferredResult;
//    }
//}
//
//
//
//
